<#import "spring.ftl" as spring/>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试国际化</title>
</head>
<body>
<select id="selection">
    <option><@spring.message code="locale.selection"/></option>
    <option value="en_US">English</option>
    <option value="zh_CN">中文简体</option>
    <option value="zh">中文</option>
</select><hr/>
<@spring.message code="loginFrom.username"/>
<br>
<@spring.message code="loginFrom.password"/>

<script src="http://libs.baidu.com/jquery/2.1.1/jquery.min.js"></script>
<script>
    $(function(){
        $("#selection").change(function(){
            var locale = $(this).val();
            $.post("/locale/change",{locale:locale},function(data){
                if(data == "success"){
                    window.location.reload();
                }else{
                    alert("错误");
                }
            });
        });
    });
</script>
</body>
</html>